﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using BE;
using DAL;
using BE.SearchCriteria;

namespace BLL
{
  public class RubroBLL : BaseBLL
    {
      public static List<RubroBE> SeleccionarTodos(BaseSC pRubroSC, int pPageSize, int? pPageNum, ref int pCountReg)
      {
          RubroDAL oRubroDAL = new RubroDAL();
          return oRubroDAL.SeleccionarPorParametros(pRubroSC, pPageSize, pPageNum, ref pCountReg);
      }

      public static RubroBE SeleccionarPorId(RubroBE oRubroBE)
      {
          RubroDAL oRubroDAL = new RubroDAL();
          return oRubroDAL.SeleccionarPorId(oRubroBE);
      }

      public static void InsertarRubro(RubroBE pRubro)
      {
          RubroDAL oRubroDAL = new RubroDAL();
          oRubroDAL.Insertar(pRubro);
      }

      public static void Modificar(RubroBE pRubro)
      {
          RubroDAL oRubroDAL = new RubroDAL();
          oRubroDAL.Modificar(pRubro);
      }

      public static void Eliminar(RubroBE pRubro)
      {
          try
          {
              RubroDAL oRubroDAL = new RubroDAL();
              oRubroDAL.Delete(pRubro);
          }
          catch (Exception ex)
          {
              if (!HandleException(ex))
                  throw;
          }

      }
    }
}
